\hypertarget{time_8h}{}\section{lib/time.h File Reference}
\label{time_8h}\index{lib/time.\+h@{lib/time.\+h}}


Common Linux/\+P\+O\+S\+IX time functions.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structtm}{tm}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX struct tm. \end{DoxyCompactList}\item 
struct \hyperlink{structtimeval}{timeval}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX timeval. \end{DoxyCompactList}\item 
struct \hyperlink{structtimezone}{timezone}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX timezone. \end{DoxyCompactList}\item 
struct \hyperlink{structtimespec}{timespec}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX timespec. \end{DoxyCompactList}\item 
struct \hyperlink{structdst__t}{dst\+\_\+t}
\begin{DoxyCompactList}\small\item\em D\+ST structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{time_8h_aa0e47af385cda59b56c1ba71dee795d8}{E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR}~1970    /$\ast$$<$ Thursday Jan 1 1970 $\ast$/
\item 
\#define \hyperlink{time_8h_af52939ab160d0d62c41282669c0214ed}{E\+P\+O\+C\+H\+\_\+\+D\+AY}~4    /$\ast$$<$ Sunday = 0 ... Saturday = 6 $\ast$/
\item 
\#define \hyperlink{time_8h_a0ac447c7f69530e0caadc891c59d7244}{E\+P\+O\+CH}~0    /$\ast$$<$ Zero \hyperlink{user__main_8c_ae112d79896ed83ac05e155da60e85523}{seconds} $\ast$/
\item 
\#define \hyperlink{time_8h_a68d645790f023c139b736dd48f0c90bf}{E\+P\+O\+C\+H\+\_\+2000}~946684800  /$\ast$$<$ Sat, 01 Jan 2000 00\+:00\+:00 G\+MT $\ast$/
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef \hyperlink{send_8c_a435d1572bf3f880d55459d9805097f62}{uint32\+\_\+t} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}
\begin{DoxyCompactList}\small\item\em type of E\+P\+O\+CH result. \end{DoxyCompactList}\item 
typedef \hyperlink{send_8c_a273cf69d639a59973b6019625df33e30}{uint16\+\_\+t} \hyperlink{time_8h_afeece078c6706f33383bf11bbf584518}{clockid\+\_\+t}
\begin{DoxyCompactList}\small\item\em type of clockid\+\_\+t. \end{DoxyCompactList}\item 
typedef struct \hyperlink{structtm}{tm} \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX struct tm typedef. \end{DoxyCompactList}\item 
typedef struct \hyperlink{structtimeval}{timeval} \hyperlink{time_8h_a23f99094ae0798225e20ad40e48658bb}{tv\+\_\+t}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX timeval typedef. \end{DoxyCompactList}\item 
typedef struct \hyperlink{structtimezone}{timezone} \hyperlink{time_8h_a63629b2492d6773f4d4948d6e60022a8}{tz\+\_\+t}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX timezone typedef. \end{DoxyCompactList}\item 
typedef struct \hyperlink{structtimespec}{timespec} \hyperlink{time_8h_a062a82a85c72b4a3020130efc37a00cf}{ts\+\_\+t}
\begin{DoxyCompactList}\small\item\em P\+O\+S\+IX timespec typedef. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_ac7a571349cf5217b6261a01bf85a79ab}{tm\+\_\+wday\+\_\+to\+\_\+ascii} (int i)
\begin{DoxyCompactList}\small\item\em Get string Short name of day from day number. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_a0dd83b6492eb8473cb55bb45d8fc6c0c}{tm\+\_\+mon\+\_\+to\+\_\+ascii} (int i)
\begin{DoxyCompactList}\small\item\em Get string Short name of Month from month number. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_ae0a1ae285cfe1e2fc598ac12f46ceaef}{finddayofweek} (int year, int month, int day)
\begin{DoxyCompactList}\small\item\em return day of week for givenn day, month, year \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_ac8aa3e3bf89628eb458ec88350b8033b}{Days\+\_\+\+Per\+\_\+\+Month} (int month, int year)
\begin{DoxyCompactList}\small\item\em days in a month \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} \hyperlink{time_8h_a09b5af92607205b927df4dcc1f2baa53}{time\+\_\+to\+\_\+tm} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} epoch, \hyperlink{earth2wireframe_8c_a32f2e37ee053cf2ce8ca28d1f74630e5}{int32\+\_\+t} offset, \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$t)
\begin{DoxyCompactList}\small\item\em Converts epoch ( seconds from 1 Jan E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR U\+TC), offset seconds, to U\+N\+IX tm $\ast$t. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} \hyperlink{time_8h_a8386ff819a39512ea00cfc78ce5a27d5}{timegm} (\hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$t)
\begin{DoxyCompactList}\small\item\em Convert tm\+\_\+t structure as G\+MT time into G\+MT seconds since 1900. All calculactions are in G\+MT regardless of timezoe settings. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_a7ffc52def0c7fbf70c50248e3f7d6a8a}{asctime\+\_\+r} (\hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$t, char $\ast$buf)
\begin{DoxyCompactList}\small\item\em Convert tm\+\_\+t $\ast$t structure into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} A\+S\+C\+II string $\ast$buf. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_a95735d85f13249a5b329308d27d1f3ee}{asctime} (\hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$t)
\begin{DoxyCompactList}\small\item\em Convert tm\+\_\+t $\ast$t structure into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} A\+S\+C\+II string. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_a1aab5ff5bdcacaf02c16153291db0ea3}{ctime\+\_\+r} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$t, char $\ast$buf)
\begin{DoxyCompactList}\small\item\em Convert local time\+\_\+t $\ast$t epoch time into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} A\+S\+C\+II string $\ast$buf. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_a77d6bba12950028852621634ffaf4835}{ctime} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$tp)
\begin{DoxyCompactList}\small\item\em Convert local time\+\_\+t $\ast$t epoch time into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} string buf\mbox{[}\mbox{]}. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} char $\ast$ \hyperlink{time_8h_acf34275ac6fb2f724205873402dc9f70}{ctime\+\_\+gm} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$tp)
\begin{DoxyCompactList}\small\item\em G\+MT version of P\+O\+S\+IX \hyperlink{time_8c_a77d6bba12950028852621634ffaf4835}{ctime()}. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$ \hyperlink{time_8h_af391cf18b3fab0e588c6c3f354b7ca18}{gmtime\+\_\+r} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$t, \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$result)
\begin{DoxyCompactList}\small\item\em Convert epoch G\+MT time\+\_\+t $\ast$tp into P\+O\+S\+IX tm\+\_\+t $\ast$result. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$ \hyperlink{time_8h_a10fe08d03c4c3da23d1e1c059f4cf3a5}{gmtime} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$tp)
\begin{DoxyCompactList}\small\item\em Convert epoch G\+MT time\+\_\+t $\ast$tp into P\+O\+S\+IX static tm\+\_\+t $\ast$t. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$ \hyperlink{time_8h_af05576742e2f8ad3924c02a6af70a86d}{localtime\+\_\+r} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$t, \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$result)
\begin{DoxyCompactList}\small\item\em Convert P\+O\+S\+IX epoch time\+\_\+t $\ast$tp into P\+O\+S\+IX tm\+\_\+t $\ast$result expressed as local time using timezone and D\+ST corrections. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$ \hyperlink{time_8h_a08eb1818fa59b3e6e1f1470ca0888572}{localtime} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$tp)
\begin{DoxyCompactList}\small\item\em Convert P\+O\+S\+IX epoch time\+\_\+t $\ast$tp into P\+O\+S\+IX tm\+\_\+t $\ast$result. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} \hyperlink{time_8h_aeafbe7f942ef85f85edbbe31e439372b}{mktime} (\hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$t)
\begin{DoxyCompactList}\small\item\em convert tm\+\_\+t structure to time\+\_\+t local time epoch \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} \hyperlink{time_8h_a3b1394c042dadbb7086e4facb6c87186}{normalize} (\hyperlink{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{tm\+\_\+t} $\ast$t, int normalize\+\_\+to\+\_\+timezone)
\begin{DoxyCompactList}\small\item\em Normalize P\+O\+S\+IX tm\+\_\+t $\ast$t struct and convert to epoch time Note\+: does not deal with D\+ST -\/ by design. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_ac363b4a4a45a4431d3c3b56886f1bef1}{gettimezone} (\hyperlink{time_8h_a63629b2492d6773f4d4948d6e60022a8}{tz\+\_\+t} $\ast$tz)
\begin{DoxyCompactList}\small\item\em Get current timezone in struct timezone $\ast$tz -\/ P\+O\+S\+IX function. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_aba9a1e17f18817099c795d0559d747a8}{settimezone} (\hyperlink{time_8h_a63629b2492d6773f4d4948d6e60022a8}{tz\+\_\+t} $\ast$tz)
\begin{DoxyCompactList}\small\item\em Set current timezone with struct timezone $\ast$tz -\/ P\+O\+S\+IX function. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_a96a115b6a8104959a7340938f150a350}{gettimeofday} (\hyperlink{time_8h_a23f99094ae0798225e20ad40e48658bb}{tv\+\_\+t} $\ast$tv, \hyperlink{time_8h_a63629b2492d6773f4d4948d6e60022a8}{tz\+\_\+t} $\ast$tz)
\begin{DoxyCompactList}\small\item\em Get current time struct timeval $\ast$tv and struct timezone $\ast$tz -\/ P\+O\+S\+IX function. We assume a G\+MT hardware clock. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} \hyperlink{time_8h_a32b1cbd925752f0cd61d202bbe204a69}{time} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} $\ast$t)
\begin{DoxyCompactList}\small\item\em Return second from epoch -\/ P\+O\+S\+IX function. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_aeb8aa93cda8bc413e67e8633793edf7e}{settimeofday} (\hyperlink{time_8h_a23f99094ae0798225e20ad40e48658bb}{tv\+\_\+t} $\ast$tv, \hyperlink{time_8h_a63629b2492d6773f4d4948d6e60022a8}{tz\+\_\+t} $\ast$tz)
\begin{DoxyCompactList}\small\item\em Set current time struct timeval $\ast$tv and struct timezone $\ast$tz -\/ P\+O\+S\+IX function. We assume a G\+MT hardware clock. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{time_8h_a054fae207409ed1e0be1c30edaab9a7b}{clock\+\_\+set} (\hyperlink{send_8c_a435d1572bf3f880d55459d9805097f62}{uint32\+\_\+t} \hyperlink{user__main_8c_ae112d79896ed83ac05e155da60e85523}{seconds}, \hyperlink{send_8c_a435d1572bf3f880d55459d9805097f62}{uint32\+\_\+t} us)
\begin{DoxyCompactList}\small\item\em Set system clock with seconds and microseconds. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_a7a02196096176d10235868e6dce48c4c}{setdate} (void)
\begin{DoxyCompactList}\small\item\em Set date and time by prompting user. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_af39c674506657f4a32793388117be705}{setdate\+\_\+r} (char $\ast$buf)
\begin{DoxyCompactList}\small\item\em Set date and time from string in this format \char`\"{}\+Y\+Y\+Y\+Y M\+M D\+D H\+H\+:\+M\+M\+:\+S\+S\char`\"{}. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} \hyperlink{time_8h_abc775c1cfa2760ddccbfe11c8c0b6efa}{find\+\_\+dst} (int \hyperlink{time_8c_a5a388b2bb2a2a9914c7d68ed3d09f7e9}{dst}, \hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} epoch, int year, int month, int weekno, int dayno, int hour)
\begin{DoxyCompactList}\small\item\em Calculate G\+MT seconds of D\+ST transition given L\+O\+C\+AL time start / end time and D\+ST flag. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{time_8h_a2c066c436f8198cf22c1f2eef5d7b67a}{set\+\_\+dst} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} epoch)
\begin{DoxyCompactList}\small\item\em Set D\+ST start and end time for the given epoch year. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{time_8h_a97ed766c965cf60b39b74a22077caf51}{is\+\_\+dst} (\hyperlink{time_8h_a3346b04b0420b32ccf6b706551b70762}{time\+\_\+t} epoch)
\begin{DoxyCompactList}\small\item\em Test G\+MT epoch time to see if D\+ST applies in a local timezone. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{time_8h_a4ad16382ead0709235ab5ea871c3d2be}{print\+\_\+dst} (void)
\begin{DoxyCompactList}\small\item\em print start/stop for D\+ST as localtime for this year \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{time_8h_a3c227da686cc61a0543ffd12c673c895}{print\+\_\+dst\+\_\+gmt} (void)
\begin{DoxyCompactList}\small\item\em print start/stop for D\+ST as G\+MT for this year \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{time_8h_a0be4566aa9ed3f590570de0787f2cc12}{initialize\+\_\+clock} (int minwest)
\begin{DoxyCompactList}\small\item\em initialize system time -\/ if we have an R\+TC use it \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{time_8h_abfb6a874f26825f5b1b82edcd614bc86}{display\+\_\+clock} (void)
\begin{DoxyCompactList}\small\item\em Display system time and optionally R\+TC time. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
volatile \hyperlink{time_8h_a062a82a85c72b4a3020130efc37a00cf}{ts\+\_\+t} \hyperlink{time_8h_a335451dd774ecb4b696d501b4c1b6f30}{\+\_\+\+\_\+clock}
\begin{DoxyCompactList}\small\item\em System Clock Time. \end{DoxyCompactList}\item 
\hyperlink{time_8h_a63629b2492d6773f4d4948d6e60022a8}{tz\+\_\+t} \hyperlink{time_8h_a9ac29ed71adf6807175d24ab1fa622a7}{\+\_\+\+\_\+tzone}
\begin{DoxyCompactList}\small\item\em System Time Zone. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Common Linux/\+P\+O\+S\+IX time functions. 

\begin{DoxyParagraph}{Copyright \copyright{} 2015 Mike Gore, G\+PL License}

\end{DoxyParagraph}
\begin{DoxyParagraph}{You are free to use this code under the terms of G\+PL}
please retain a copy of this notice in any code you use it in.
\end{DoxyParagraph}
This is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU General Public License for more details.

You should have received a copy of the G\+NU General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}. 

\subsection{Macro Definition Documentation}
\index{time.\+h@{time.\+h}!E\+P\+O\+CH@{E\+P\+O\+CH}}
\index{E\+P\+O\+CH@{E\+P\+O\+CH}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{E\+P\+O\+CH}{EPOCH}}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+P\+O\+CH~0    /$\ast$$<$ Zero {\bf seconds} $\ast$/}\hypertarget{time_8h_a0ac447c7f69530e0caadc891c59d7244}{}\label{time_8h_a0ac447c7f69530e0caadc891c59d7244}


Definition at line 31 of file time.\+h.

\index{time.\+h@{time.\+h}!E\+P\+O\+C\+H\+\_\+2000@{E\+P\+O\+C\+H\+\_\+2000}}
\index{E\+P\+O\+C\+H\+\_\+2000@{E\+P\+O\+C\+H\+\_\+2000}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{E\+P\+O\+C\+H\+\_\+2000}{EPOCH_2000}}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+P\+O\+C\+H\+\_\+2000~946684800  /$\ast$$<$ Sat, 01 Jan 2000 00\+:00\+:00 G\+MT $\ast$/}\hypertarget{time_8h_a68d645790f023c139b736dd48f0c90bf}{}\label{time_8h_a68d645790f023c139b736dd48f0c90bf}


Definition at line 32 of file time.\+h.

\index{time.\+h@{time.\+h}!E\+P\+O\+C\+H\+\_\+\+D\+AY@{E\+P\+O\+C\+H\+\_\+\+D\+AY}}
\index{E\+P\+O\+C\+H\+\_\+\+D\+AY@{E\+P\+O\+C\+H\+\_\+\+D\+AY}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{E\+P\+O\+C\+H\+\_\+\+D\+AY}{EPOCH_DAY}}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+P\+O\+C\+H\+\_\+\+D\+AY~4    /$\ast$$<$ Sunday = 0 ... Saturday = 6 $\ast$/}\hypertarget{time_8h_af52939ab160d0d62c41282669c0214ed}{}\label{time_8h_af52939ab160d0d62c41282669c0214ed}


Definition at line 30 of file time.\+h.



Referenced by time\+\_\+to\+\_\+tm().

\index{time.\+h@{time.\+h}!E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR@{E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR}}
\index{E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR@{E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR}{EPOCH_YEAR}}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR~1970    /$\ast$$<$ Thursday Jan 1 1970 $\ast$/}\hypertarget{time_8h_aa0e47af385cda59b56c1ba71dee795d8}{}\label{time_8h_aa0e47af385cda59b56c1ba71dee795d8}


Definition at line 29 of file time.\+h.



Referenced by time\+\_\+to\+\_\+tm(), timetests(), and tm2epoch().



\subsection{Typedef Documentation}
\index{time.\+h@{time.\+h}!clockid\+\_\+t@{clockid\+\_\+t}}
\index{clockid\+\_\+t@{clockid\+\_\+t}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{clockid\+\_\+t}{clockid_t}}]{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf uint16\+\_\+t} {\bf clockid\+\_\+t}}\hypertarget{time_8h_afeece078c6706f33383bf11bbf584518}{}\label{time_8h_afeece078c6706f33383bf11bbf584518}


type of clockid\+\_\+t. 



Definition at line 38 of file time.\+h.

\index{time.\+h@{time.\+h}!time\+\_\+t@{time\+\_\+t}}
\index{time\+\_\+t@{time\+\_\+t}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{time\+\_\+t}{time_t}}]{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf uint32\+\_\+t} {\bf time\+\_\+t}}\hypertarget{time_8h_a3346b04b0420b32ccf6b706551b70762}{}\label{time_8h_a3346b04b0420b32ccf6b706551b70762}


type of E\+P\+O\+CH result. 



Definition at line 35 of file time.\+h.

\index{time.\+h@{time.\+h}!tm\+\_\+t@{tm\+\_\+t}}
\index{tm\+\_\+t@{tm\+\_\+t}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{tm\+\_\+t}{tm_t}}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf tm} {\bf tm\+\_\+t}}\hypertarget{time_8h_a2fea857c30e2c901566fcf45fac68ac5}{}\label{time_8h_a2fea857c30e2c901566fcf45fac68ac5}


P\+O\+S\+IX struct tm typedef. 

tm\+\_\+isdst value notes 1 D\+ST in effect -\/ add an hour 0 D\+ST not in effect -\/1 D\+ST Unknown status 

Definition at line 64 of file time.\+h.

\index{time.\+h@{time.\+h}!ts\+\_\+t@{ts\+\_\+t}}
\index{ts\+\_\+t@{ts\+\_\+t}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{ts\+\_\+t}{ts_t}}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf timespec} {\bf ts\+\_\+t}}\hypertarget{time_8h_a062a82a85c72b4a3020130efc37a00cf}{}\label{time_8h_a062a82a85c72b4a3020130efc37a00cf}


P\+O\+S\+IX timespec typedef. 



Definition at line 95 of file time.\+h.

\index{time.\+h@{time.\+h}!tv\+\_\+t@{tv\+\_\+t}}
\index{tv\+\_\+t@{tv\+\_\+t}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{tv\+\_\+t}{tv_t}}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf timeval} {\bf tv\+\_\+t}}\hypertarget{time_8h_a23f99094ae0798225e20ad40e48658bb}{}\label{time_8h_a23f99094ae0798225e20ad40e48658bb}


P\+O\+S\+IX timeval typedef. 



Definition at line 75 of file time.\+h.

\index{time.\+h@{time.\+h}!tz\+\_\+t@{tz\+\_\+t}}
\index{tz\+\_\+t@{tz\+\_\+t}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{tz\+\_\+t}{tz_t}}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf timezone} {\bf tz\+\_\+t}}\hypertarget{time_8h_a63629b2492d6773f4d4948d6e60022a8}{}\label{time_8h_a63629b2492d6773f4d4948d6e60022a8}


P\+O\+S\+IX timezone typedef. 



Definition at line 85 of file time.\+h.



\subsection{Function Documentation}
\index{time.\+h@{time.\+h}!asctime@{asctime}}
\index{asctime@{asctime}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{asctime(tm\+\_\+t $\ast$t)}{asctime(tm_t *t)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ asctime (
\begin{DoxyParamCaption}
\item[{{\bf tm\+\_\+t} $\ast$}]{t}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a95735d85f13249a5b329308d27d1f3ee}{}\label{time_8h_a95735d85f13249a5b329308d27d1f3ee}


Convert tm\+\_\+t $\ast$t structure into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} A\+S\+C\+II string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & struct tm $\ast$ time input.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
buf\mbox{[}\mbox{]} string pointer in P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} format.
\begin{DoxyItemize}
\item Example output\+: \char`\"{}\+Thu Dec  8 21\+:45\+:05 E\+S\+T 2011\char`\"{}. 
\end{DoxyItemize}
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
result is overwritten on each call. 
\end{DoxyWarning}


Definition at line 394 of file time.\+c.



Referenced by display\+\_\+clock(), get\+\_\+date(), and ntp\+\_\+setup().

\index{time.\+h@{time.\+h}!asctime\+\_\+r@{asctime\+\_\+r}}
\index{asctime\+\_\+r@{asctime\+\_\+r}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{asctime\+\_\+r(tm\+\_\+t $\ast$t, char $\ast$buf)}{asctime_r(tm_t *t, char *buf)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ asctime\+\_\+r (
\begin{DoxyParamCaption}
\item[{{\bf tm\+\_\+t} $\ast$}]{t, }
\item[{char $\ast$}]{buf}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a7ffc52def0c7fbf70c50248e3f7d6a8a}{}\label{time_8h_a7ffc52def0c7fbf70c50248e3f7d6a8a}


Convert tm\+\_\+t $\ast$t structure into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} A\+S\+C\+II string $\ast$buf. 

\begin{DoxyRefDesc}{Todo}
\item[\hyperlink{todo__todo000001}{Todo}]implement strftime() and strptime() \end{DoxyRefDesc}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & tm\+\_\+t structure pointer. \\
\hline
\mbox{\tt out}  & {\em buf} & user buffer for P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} string result.
\begin{DoxyItemize}
\item Example output\+: \char`\"{}\+Thu Dec  8 21\+:45\+:05 E\+S\+T 2011\char`\"{}.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
buf string pointer. 
\end{DoxyReturn}


Definition at line 367 of file time.\+c.



Referenced by asctime(), ctime(), ctime\+\_\+gm(), ctime\+\_\+r(), and timetests().

\index{time.\+h@{time.\+h}!clock\+\_\+set@{clock\+\_\+set}}
\index{clock\+\_\+set@{clock\+\_\+set}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{clock\+\_\+set(uint32\+\_\+t seconds, uint32\+\_\+t us)}{clock_set(uint32_t seconds, uint32_t us)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void clock\+\_\+set (
\begin{DoxyParamCaption}
\item[{{\bf uint32\+\_\+t}}]{seconds, }
\item[{{\bf uint32\+\_\+t}}]{us}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a054fae207409ed1e0be1c30edaab9a7b}{}\label{time_8h_a054fae207409ed1e0be1c30edaab9a7b}


Set system clock with seconds and microseconds. 


\begin{DoxyItemize}
\item Note\+: Alternate clock functions. \begin{DoxyReturn}{Returns}
void. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{timer_8c_a4ebca9883466f2cc6fea0547e0e64e79}{clock\+\_\+settime()}. 
\end{DoxySeeAlso}

\end{DoxyItemize}

Definition at line 882 of file time.\+c.

\index{time.\+h@{time.\+h}!ctime@{ctime}}
\index{ctime@{ctime}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{ctime(time\+\_\+t $\ast$tp)}{ctime(time_t *tp)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ ctime (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{tp}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a77d6bba12950028852621634ffaf4835}{}\label{time_8h_a77d6bba12950028852621634ffaf4835}


Convert local time\+\_\+t $\ast$t epoch time into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} string buf\mbox{[}\mbox{]}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tp} & time\+\_\+t $\ast$ time input.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
buf\mbox{[}\mbox{]}.
\begin{DoxyItemize}
\item Example\+: \char`\"{}\+Thu Dec  8 21\+:45\+:05 E\+S\+T 2011\char`\"{}. 
\end{DoxyItemize}
\end{DoxyReturn}


Definition at line 424 of file time.\+c.



Referenced by ntp\+\_\+setup(), print\+\_\+dst(), user\+\_\+loop(), and user\+\_\+tests().

\index{time.\+h@{time.\+h}!ctime\+\_\+gm@{ctime\+\_\+gm}}
\index{ctime\+\_\+gm@{ctime\+\_\+gm}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{ctime\+\_\+gm(time\+\_\+t $\ast$tp)}{ctime_gm(time_t *tp)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ ctime\+\_\+gm (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{tp}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_acf34275ac6fb2f724205873402dc9f70}{}\label{time_8h_acf34275ac6fb2f724205873402dc9f70}


G\+MT version of P\+O\+S\+IX \hyperlink{time_8c_a77d6bba12950028852621634ffaf4835}{ctime()}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tp} & time\+\_\+t $\ast$ time input.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
buf\mbox{[}\mbox{]}.
\begin{DoxyItemize}
\item Example\+: \char`\"{}\+Thu Dec  8 21\+:45\+:05 E\+S\+T 2011\char`\"{}. 
\end{DoxyItemize}
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{time_8c_a77d6bba12950028852621634ffaf4835}{ctime()} 
\end{DoxySeeAlso}
\begin{DoxyWarning}{Warning}
result is overwritten on each call. 
\end{DoxyWarning}


Definition at line 441 of file time.\+c.



Referenced by mctime(), ntp\+\_\+setup(), and print\+\_\+dst\+\_\+gmt().

\index{time.\+h@{time.\+h}!ctime\+\_\+r@{ctime\+\_\+r}}
\index{ctime\+\_\+r@{ctime\+\_\+r}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{ctime\+\_\+r(time\+\_\+t $\ast$t, char $\ast$buf)}{ctime_r(time_t *t, char *buf)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ ctime\+\_\+r (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{t, }
\item[{char $\ast$}]{buf}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a1aab5ff5bdcacaf02c16153291db0ea3}{}\label{time_8h_a1aab5ff5bdcacaf02c16153291db0ea3}


Convert local time\+\_\+t $\ast$t epoch time into P\+O\+S\+IX \hyperlink{time_8c_a95735d85f13249a5b329308d27d1f3ee}{asctime()} A\+S\+C\+II string $\ast$buf. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & time\+\_\+t $\ast$ time input. \\
\hline
\mbox{\tt out}  & {\em buf} & string output.
\begin{DoxyItemize}
\item Example output\+: \char`\"{}\+Thu Dec  8 21\+:45\+:05 E\+S\+T 2011\char`\"{}
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
buf string pointer. 
\end{DoxyReturn}


Definition at line 410 of file time.\+c.

\index{time.\+h@{time.\+h}!Days\+\_\+\+Per\+\_\+\+Month@{Days\+\_\+\+Per\+\_\+\+Month}}
\index{Days\+\_\+\+Per\+\_\+\+Month@{Days\+\_\+\+Per\+\_\+\+Month}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{Days\+\_\+\+Per\+\_\+\+Month(int month, int year)}{Days_Per_Month(int month, int year)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int Days\+\_\+\+Per\+\_\+\+Month (
\begin{DoxyParamCaption}
\item[{int}]{month, }
\item[{int}]{year}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_ac8aa3e3bf89628eb458ec88350b8033b}{}\label{time_8h_ac8aa3e3bf89628eb458ec88350b8033b}


days in a month 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em month;} & month of year \\
\hline
\mbox{\tt in}  & {\em year;} & year\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
days in month including yeapyears 
\end{DoxyReturn}


Definition at line 223 of file time.\+c.



Referenced by normalize(), and tm2epoch().

\index{time.\+h@{time.\+h}!display\+\_\+clock@{display\+\_\+clock}}
\index{display\+\_\+clock@{display\+\_\+clock}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{display\+\_\+clock(void)}{display_clock(void)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void display\+\_\+clock (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_abfb6a874f26825f5b1b82edcd614bc86}{}\label{time_8h_abfb6a874f26825f5b1b82edcd614bc86}


Display system time and optionally R\+TC time. 

\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\+: \hyperlink{rtc_8h_ab6c620f2f0bcbe90b65ecc723c03b645}{rtc\+\_\+read} 

\+: \hyperlink{time_8c_a8386ff819a39512ea00cfc78ce5a27d5}{timegm()} 

\+: ascitime() 
\end{DoxySeeAlso}


Definition at line 1227 of file time.\+c.



Referenced by user\+\_\+tests().

\index{time.\+h@{time.\+h}!find\+\_\+dst@{find\+\_\+dst}}
\index{find\+\_\+dst@{find\+\_\+dst}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{find\+\_\+dst(int dst, time\+\_\+t epoch, int year, int month, int weekno, int dayno, int hour)}{find_dst(int dst, time_t epoch, int year, int month, int weekno, int dayno, int hour)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf time\+\_\+t} find\+\_\+dst (
\begin{DoxyParamCaption}
\item[{int}]{dst, }
\item[{{\bf time\+\_\+t}}]{epoch, }
\item[{int}]{year, }
\item[{int}]{month, }
\item[{int}]{weekno, }
\item[{int}]{dayno, }
\item[{int}]{hour}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_abc775c1cfa2760ddccbfe11c8c0b6efa}{}\label{time_8h_abc775c1cfa2760ddccbfe11c8c0b6efa}


Calculate G\+MT seconds of D\+ST transition given L\+O\+C\+AL time start / end time and D\+ST flag. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em dst} & 0 .. 1 D\+ST needs to be applied to the arguments for D\+ST caluclulations \\
\hline
\mbox{\tt in}  & {\em epoch} & 0 $\vert$ epoch if non-\/zero -\/ U\+TC epoch time used to obtain year of D\+ST calculations \\
\hline
\mbox{\tt in}  & {\em year} & 0 $\vert$ year if non-\/zero -\/ U\+TC year of D\+ST calcululation, if year and epoch are used -\/ ignore epoch \\
\hline
\mbox{\tt in}  & {\em month} & 0 .. 11, local time month D\+ST transition \\
\hline
\mbox{\tt in}  & {\em weekno} & 1 .. 4 localtime dayno count in this month \\
\hline
\mbox{\tt in}  & {\em dayno} & 0 .. 6, localtime day of D\+ST transition, 0 = Sunday \\
\hline
\mbox{\tt in}  & {\em hour} & 0 .. 23 local time hour of D\+ST transition result is in epoch G\+MT seconds Example\+: Eastern Time and Daylight Savings time time\+\_\+t epoch,start,end; tv\+\_\+t tv; tv\+\_\+t tz; gettimeofday(\&tv, \&tz); epoch = tv.\+tv\+\_\+sec; // D\+ST start for this year, 2nd Sunday of Mar at 2\+:00am E\+ST start = find\+\_\+dst(0, epoch, 0,  3, 2, 0, 2); // D\+ST start on 2016, 2nd Sunday of Mar at 2\+:00am E\+ST start = find\+\_\+dst(0, 0, 2016,  3, 2, 0, 2); // D\+ST ends on for this year, 1st Sunday of Nov at 2\+:00am D\+ST end = find\+\_\+dst(1, epoch, 0, 11, 1, 0, 2); // D\+ST ends on 2016, 1st Sunday of Nov at 2\+:00am D\+ST end = find\+\_\+dst(1, 0, 2016, 11, 1, 0, 2); \\
\hline
\end{DoxyParams}


Definition at line 1038 of file time.\+c.



Referenced by set\+\_\+dst().

\index{time.\+h@{time.\+h}!finddayofweek@{finddayofweek}}
\index{finddayofweek@{finddayofweek}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{finddayofweek(int year, int month, int day)}{finddayofweek(int year, int month, int day)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int finddayofweek (
\begin{DoxyParamCaption}
\item[{int}]{year, }
\item[{int}]{month, }
\item[{int}]{day}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_ae0a1ae285cfe1e2fc598ac12f46ceaef}{}\label{time_8h_ae0a1ae285cfe1e2fc598ac12f46ceaef}


return day of week for givenn day, month, year 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em year} & year such as 2016 \\
\hline
\mbox{\tt in}  & {\em month} & month 0 .. 11 \\
\hline
\mbox{\tt in}  & {\em day} & day 1 .. 28$\vert$29$\vert$30$\vert$31 result is day of week 0 .. 6, 0 = Sunday \\
\hline
\end{DoxyParams}


Definition at line 180 of file time.\+c.

\index{time.\+h@{time.\+h}!gettimeofday@{gettimeofday}}
\index{gettimeofday@{gettimeofday}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{gettimeofday(tv\+\_\+t $\ast$tv, tz\+\_\+t $\ast$tz)}{gettimeofday(tv_t *tv, tz_t *tz)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int gettimeofday (
\begin{DoxyParamCaption}
\item[{{\bf tv\+\_\+t} $\ast$}]{tv, }
\item[{{\bf tz\+\_\+t} $\ast$}]{tz}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a96a115b6a8104959a7340938f150a350}{}\label{time_8h_a96a115b6a8104959a7340938f150a350}


Get current time struct timeval $\ast$tv and struct timezone $\ast$tz -\/ P\+O\+S\+IX function. We assume a G\+MT hardware clock. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tv} & time. \\
\hline
\mbox{\tt in}  & {\em tz} & timezone.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 
\end{DoxyReturn}


Definition at line 822 of file time.\+c.



Referenced by find\+\_\+dst(), set\+\_\+dst(), and timetests().

\index{time.\+h@{time.\+h}!gettimezone@{gettimezone}}
\index{gettimezone@{gettimezone}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{gettimezone(tz\+\_\+t $\ast$tz)}{gettimezone(tz_t *tz)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int gettimezone (
\begin{DoxyParamCaption}
\item[{{\bf tz\+\_\+t} $\ast$}]{tz}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_ac363b4a4a45a4431d3c3b56886f1bef1}{}\label{time_8h_ac363b4a4a45a4431d3c3b56886f1bef1}


Get current timezone in struct timezone $\ast$tz -\/ P\+O\+S\+IX function. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em tz} & timezone result.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 
\end{DoxyReturn}


Definition at line 792 of file time.\+c.



Referenced by gettimeofday(), localtime\+\_\+r(), and normalize().

\index{time.\+h@{time.\+h}!gmtime@{gmtime}}
\index{gmtime@{gmtime}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{gmtime(time\+\_\+t $\ast$tp)}{gmtime(time_t *tp)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf tm\+\_\+t}$\ast$ gmtime (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{tp}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a10fe08d03c4c3da23d1e1c059f4cf3a5}{}\label{time_8h_a10fe08d03c4c3da23d1e1c059f4cf3a5}


Convert epoch G\+MT time\+\_\+t $\ast$tp into P\+O\+S\+IX static tm\+\_\+t $\ast$t. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tp} & time\+\_\+t $\ast$ time input.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
tm\+\_\+t t. 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
result is overwritten on each call. 
\end{DoxyWarning}


Definition at line 471 of file time.\+c.



Referenced by display\+\_\+clock(), ntp\+\_\+setup(), rtc\+\_\+init(), and unix\+\_\+time\+\_\+to\+\_\+fat().

\index{time.\+h@{time.\+h}!gmtime\+\_\+r@{gmtime\+\_\+r}}
\index{gmtime\+\_\+r@{gmtime\+\_\+r}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{gmtime\+\_\+r(time\+\_\+t $\ast$t, tm\+\_\+t $\ast$result)}{gmtime_r(time_t *t, tm_t *result)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf tm\+\_\+t}$\ast$ gmtime\+\_\+r (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{t, }
\item[{{\bf tm\+\_\+t} $\ast$}]{result}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_af391cf18b3fab0e588c6c3f354b7ca18}{}\label{time_8h_af391cf18b3fab0e588c6c3f354b7ca18}


Convert epoch G\+MT time\+\_\+t $\ast$tp into P\+O\+S\+IX tm\+\_\+t $\ast$result. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tp} & time\+\_\+t $\ast$ time input. \\
\hline
\mbox{\tt out}  & {\em result} & tm\+\_\+t $\ast$result.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
tm\+\_\+t $\ast$result. 
\end{DoxyReturn}


Definition at line 456 of file time.\+c.



Referenced by ctime\+\_\+gm(), and gmtime().

\index{time.\+h@{time.\+h}!initialize\+\_\+clock@{initialize\+\_\+clock}}
\index{initialize\+\_\+clock@{initialize\+\_\+clock}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{initialize\+\_\+clock(int minwest)}{initialize_clock(int minwest)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void initialize\+\_\+clock (
\begin{DoxyParamCaption}
\item[{int}]{minwest}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a0be4566aa9ed3f590570de0787f2cc12}{}\label{time_8h_a0be4566aa9ed3f590570de0787f2cc12}


initialize system time -\/ if we have an R\+TC use it 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em minwest} & your time zone as minute west \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\+: \hyperlink{timer_8c_a4ebca9883466f2cc6fea0547e0e64e79}{clock\+\_\+settime()} 
\end{DoxySeeAlso}


Definition at line 1178 of file time.\+c.



Referenced by setup().

\index{time.\+h@{time.\+h}!is\+\_\+dst@{is\+\_\+dst}}
\index{is\+\_\+dst@{is\+\_\+dst}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{is\+\_\+dst(time\+\_\+t epoch)}{is_dst(time_t epoch)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int is\+\_\+dst (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t}}]{epoch}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a97ed766c965cf60b39b74a22077caf51}{}\label{time_8h_a97ed766c965cf60b39b74a22077caf51}


Test G\+MT epoch time to see if D\+ST applies in a local timezone. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em epoch} & seconds in G\+MT  \hyperlink{time_8c_a3b1394c042dadbb7086e4facb6c87186}{normalize()} return 1 if yes, 0 if not \\
\hline
\end{DoxyParams}


Definition at line 1147 of file time.\+c.



Referenced by localtime\+\_\+r(), and normalize().

\index{time.\+h@{time.\+h}!localtime@{localtime}}
\index{localtime@{localtime}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{localtime(time\+\_\+t $\ast$tp)}{localtime(time_t *tp)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf tm\+\_\+t}$\ast$ localtime (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{tp}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a08eb1818fa59b3e6e1f1470ca0888572}{}\label{time_8h_a08eb1818fa59b3e6e1f1470ca0888572}


Convert P\+O\+S\+IX epoch time\+\_\+t $\ast$tp into P\+O\+S\+IX tm\+\_\+t $\ast$result. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tp} & time\+\_\+t $\ast$ epoch time input.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
struct tm result. 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
result is overwritten on each call. 
\end{DoxyWarning}


Definition at line 522 of file time.\+c.



Referenced by ctime(), ctime\+\_\+r(), get\+\_\+date(), and get\+\_\+fattime().

\index{time.\+h@{time.\+h}!localtime\+\_\+r@{localtime\+\_\+r}}
\index{localtime\+\_\+r@{localtime\+\_\+r}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{localtime\+\_\+r(time\+\_\+t $\ast$t, tm\+\_\+t $\ast$result)}{localtime_r(time_t *t, tm_t *result)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf tm\+\_\+t}$\ast$ localtime\+\_\+r (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{t, }
\item[{{\bf tm\+\_\+t} $\ast$}]{result}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_af05576742e2f8ad3924c02a6af70a86d}{}\label{time_8h_af05576742e2f8ad3924c02a6af70a86d}


Convert P\+O\+S\+IX epoch time\+\_\+t $\ast$tp into P\+O\+S\+IX tm\+\_\+t $\ast$result expressed as local time using timezone and D\+ST corrections. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & time\+\_\+t $\ast$ epoch time input. \\
\hline
\mbox{\tt out}  & {\em result} & tm\+\_\+t $\ast$result.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
result. 
\end{DoxyReturn}


Definition at line 499 of file time.\+c.



Referenced by localtime(), and timetests().

\index{time.\+h@{time.\+h}!mktime@{mktime}}
\index{mktime@{mktime}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{mktime(tm\+\_\+t $\ast$t)}{mktime(tm_t *t)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf time\+\_\+t} mktime (
\begin{DoxyParamCaption}
\item[{{\bf tm\+\_\+t} $\ast$}]{t}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_aeafbe7f942ef85f85edbbe31e439372b}{}\label{time_8h_aeafbe7f942ef85f85edbbe31e439372b}


convert tm\+\_\+t structure to time\+\_\+t local time epoch 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & tm\+\_\+t time input.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
local epoch or -\/1 on failure out of range 
\end{DoxyReturn}


Definition at line 534 of file time.\+c.



Referenced by ntp\+\_\+setup(), and timetests().

\index{time.\+h@{time.\+h}!normalize@{normalize}}
\index{normalize@{normalize}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{normalize(tm\+\_\+t $\ast$t, int normalize\+\_\+to\+\_\+timezone)}{normalize(tm_t *t, int normalize_to_timezone)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf time\+\_\+t} normalize (
\begin{DoxyParamCaption}
\item[{{\bf tm\+\_\+t} $\ast$}]{t, }
\item[{int}]{normalize\+\_\+to\+\_\+timezone}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a3b1394c042dadbb7086e4facb6c87186}{}\label{time_8h_a3b1394c042dadbb7086e4facb6c87186}


Normalize P\+O\+S\+IX tm\+\_\+t $\ast$t struct and convert to epoch time Note\+: does not deal with D\+ST -\/ by design. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & tm\+\_\+t time input. \\
\hline
\mbox{\tt in}  & {\em normalize\+\_\+to\+\_\+timezone} & nonzero = adjust to local timezone and D\+ST\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
epoch since 1900 on sucess, -\/1 on failure out of range 
\end{DoxyReturn}


Definition at line 654 of file time.\+c.



Referenced by asctime\+\_\+r(), mktime(), and timegm().

\index{time.\+h@{time.\+h}!print\+\_\+dst@{print\+\_\+dst}}
\index{print\+\_\+dst@{print\+\_\+dst}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{print\+\_\+dst(void)}{print_dst(void)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void print\+\_\+dst (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a4ad16382ead0709235ab5ea871c3d2be}{}\label{time_8h_a4ad16382ead0709235ab5ea871c3d2be}


print start/stop for D\+ST as localtime for this year 



Definition at line 1158 of file time.\+c.



Referenced by ntp\+\_\+setup().

\index{time.\+h@{time.\+h}!print\+\_\+dst\+\_\+gmt@{print\+\_\+dst\+\_\+gmt}}
\index{print\+\_\+dst\+\_\+gmt@{print\+\_\+dst\+\_\+gmt}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{print\+\_\+dst\+\_\+gmt(void)}{print_dst_gmt(void)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void print\+\_\+dst\+\_\+gmt (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a3c227da686cc61a0543ffd12c673c895}{}\label{time_8h_a3c227da686cc61a0543ffd12c673c895}


print start/stop for D\+ST as G\+MT for this year 



Definition at line 1166 of file time.\+c.



Referenced by ntp\+\_\+setup().

\index{time.\+h@{time.\+h}!set\+\_\+dst@{set\+\_\+dst}}
\index{set\+\_\+dst@{set\+\_\+dst}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{set\+\_\+dst(time\+\_\+t epoch)}{set_dst(time_t epoch)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void set\+\_\+dst (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t}}]{epoch}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a2c066c436f8198cf22c1f2eef5d7b67a}{}\label{time_8h_a2c066c436f8198cf22c1f2eef5d7b67a}


Set D\+ST start and end time for the given epoch year. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em 0} & -\/ or epoch seconds in G\+MT used to determin the year to aply D\+ST in If 0 we get local G\+MT epoch time in seconds \\
\hline
\end{DoxyParams}


Definition at line 1113 of file time.\+c.



Referenced by is\+\_\+dst(), and ntp\+\_\+setup().

\index{time.\+h@{time.\+h}!setdate@{setdate}}
\index{setdate@{setdate}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{setdate(void)}{setdate(void)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int setdate (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a7a02196096176d10235868e6dce48c4c}{}\label{time_8h_a7a02196096176d10235868e6dce48c4c}


Set date and time by prompting user. 


\begin{DoxyItemize}
\item Prompt use for Date Time input with \char`\"{}\+Y\+Y\+Y\+Y M\+M D\+D H\+H\+:\+M\+M\+:\+S\+S$>$\char`\"{}
\item Input format is\+: \char`\"{}\+Y\+Y\+Y\+Y M\+M D\+D H\+H\+:\+M\+M\+:\+S\+S\char`\"{}
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
0 on success. 

-\/1 on error$>$ 
\end{DoxyReturn}


Definition at line 901 of file time.\+c.

\index{time.\+h@{time.\+h}!setdate\+\_\+r@{setdate\+\_\+r}}
\index{setdate\+\_\+r@{setdate\+\_\+r}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{setdate\+\_\+r(char $\ast$buf)}{setdate_r(char *buf)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int setdate\+\_\+r (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{buf}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_af39c674506657f4a32793388117be705}{}\label{time_8h_af39c674506657f4a32793388117be705}


Set date and time from string in this format \char`\"{}\+Y\+Y\+Y\+Y M\+M D\+D H\+H\+:\+M\+M\+:\+S\+S\char`\"{}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em buf} & Date string in this format \char`\"{}\+Y\+Y\+Y\+Y M\+M D\+D H\+H\+:\+M\+M\+:\+S\+S\char`\"{}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success. 

(-\/1) on error. 
\end{DoxyReturn}


Definition at line 919 of file time.\+c.



Referenced by setdate(), and user\+\_\+tests().

\index{time.\+h@{time.\+h}!settimeofday@{settimeofday}}
\index{settimeofday@{settimeofday}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{settimeofday(tv\+\_\+t $\ast$tv, tz\+\_\+t $\ast$tz)}{settimeofday(tv_t *tv, tz_t *tz)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int settimeofday (
\begin{DoxyParamCaption}
\item[{{\bf tv\+\_\+t} $\ast$}]{tv, }
\item[{{\bf tz\+\_\+t} $\ast$}]{tz}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_aeb8aa93cda8bc413e67e8633793edf7e}{}\label{time_8h_aeb8aa93cda8bc413e67e8633793edf7e}


Set current time struct timeval $\ast$tv and struct timezone $\ast$tz -\/ P\+O\+S\+IX function. We assume a G\+MT hardware clock. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tv} & time. \\
\hline
\mbox{\tt in}  & {\em tz} & timezone.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 
\end{DoxyReturn}


Definition at line 861 of file time.\+c.



Referenced by ntp\+\_\+setup().

\index{time.\+h@{time.\+h}!settimezone@{settimezone}}
\index{settimezone@{settimezone}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{settimezone(tz\+\_\+t $\ast$tz)}{settimezone(tz_t *tz)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int settimezone (
\begin{DoxyParamCaption}
\item[{{\bf tz\+\_\+t} $\ast$}]{tz}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_aba9a1e17f18817099c795d0559d747a8}{}\label{time_8h_aba9a1e17f18817099c795d0559d747a8}


Set current timezone with struct timezone $\ast$tz -\/ P\+O\+S\+IX function. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em tz} & timezone result.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0. 
\end{DoxyReturn}


Definition at line 806 of file time.\+c.



Referenced by initialize\+\_\+clock(), and settimeofday().

\index{time.\+h@{time.\+h}!time@{time}}
\index{time@{time}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{time(time\+\_\+t $\ast$t)}{time(time_t *t)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf time\+\_\+t} time (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t} $\ast$}]{t}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a32b1cbd925752f0cd61d202bbe204a69}{}\label{time_8h_a32b1cbd925752f0cd61d202bbe204a69}


Return second from epoch -\/ P\+O\+S\+IX function. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em t} & pointer to store time in.
\begin{DoxyItemize}
\item Notes\+: If t is non-\/\+N\+U\+LL, store the return value there also. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
time\+\_\+t seconds from epoch. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{timer_8c_aa6e5b6a9c1fb8bc6e2093fca40600bf5}{clock\+\_\+gettime()}. 
\end{DoxySeeAlso}


Definition at line 843 of file time.\+c.



Referenced by get\+\_\+date(), get\+\_\+fattime(), setup(), user\+\_\+loop(), user\+\_\+tests(), and utime().

\index{time.\+h@{time.\+h}!time\+\_\+to\+\_\+tm@{time\+\_\+to\+\_\+tm}}
\index{time\+\_\+to\+\_\+tm@{time\+\_\+to\+\_\+tm}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{time\+\_\+to\+\_\+tm(time\+\_\+t epoch, int32\+\_\+t offset, tm\+\_\+t $\ast$t)}{time_to_tm(time_t epoch, int32_t offset, tm_t *t)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf time\+\_\+t} time\+\_\+to\+\_\+tm (
\begin{DoxyParamCaption}
\item[{{\bf time\+\_\+t}}]{epoch, }
\item[{{\bf int32\+\_\+t}}]{offset, }
\item[{{\bf tm\+\_\+t} $\ast$}]{t}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a09b5af92607205b927df4dcc1f2baa53}{}\label{time_8h_a09b5af92607205b927df4dcc1f2baa53}


Converts epoch ( seconds from 1 Jan E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR U\+TC), offset seconds, to U\+N\+IX tm $\ast$t. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em epoch} & Seconds elapsed since January 1, E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR.
\begin{DoxyItemize}
\item unsigned long, range limited to\+: 0 .. 0x\+F\+F\+F\+D5\+D00$>$
\item The range 0x\+F\+F\+F\+E\+A\+E80 .. 0x\+F\+F\+F\+F\+F\+F\+FF is reserverd for Dec 31, 1969.
\item The range 0x\+F\+F\+F\+D5\+D00 .. 0x\+F\+F\+F\+E\+A\+E7F is reserverd of offset overflow. 
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em offset} & Offset in seconds to localtime.
\begin{DoxyItemize}
\item long int, range limited to +/-\/ 86400.
\item (Number of seconds that we add to U\+TC to get local time). 
\end{DoxyItemize}\\
\hline
\mbox{\tt out}  & {\em t} & Unix tm struct pointer output. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
epoch\+: time in seconds, $\ast$t has result. 

-\/1\+: error.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{time_8c_acf34275ac6fb2f724205873402dc9f70}{ctime\+\_\+gm()} 

\hyperlink{time_8c_af391cf18b3fab0e588c6c3f354b7ca18}{gmtime\+\_\+r()} 

\hyperlink{time_8c_af05576742e2f8ad3924c02a6af70a86d}{localtime\+\_\+r()} 
\end{DoxySeeAlso}


Definition at line 262 of file time.\+c.



Referenced by find\+\_\+dst(), gmtime\+\_\+r(), localtime\+\_\+r(), and normalize().

\index{time.\+h@{time.\+h}!timegm@{timegm}}
\index{timegm@{timegm}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{timegm(tm\+\_\+t $\ast$t)}{timegm(tm_t *t)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} {\bf time\+\_\+t} timegm (
\begin{DoxyParamCaption}
\item[{{\bf tm\+\_\+t} $\ast$}]{t}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a8386ff819a39512ea00cfc78ce5a27d5}{}\label{time_8h_a8386ff819a39512ea00cfc78ce5a27d5}


Convert tm\+\_\+t structure as G\+MT time into G\+MT seconds since 1900. All calculactions are in G\+MT regardless of timezoe settings. 


\begin{DoxyItemize}
\item Standards\+: G\+NU and B\+SD.
\item Limits\+: year(1900..2199).
\item Assume\+: epoch size is time\+\_\+t;
\end{DoxyItemize}

\begin{DoxySeeAlso}{See also}
\hyperlink{time_8c_aeafbe7f942ef85f85edbbe31e439372b}{mktime()} \hyperlink{posix_8h_a1c3d85ae80df5590fa314acffd8bf840}{P\+O\+S\+IX} function. 

\hyperlink{time_8c_a8386ff819a39512ea00cfc78ce5a27d5}{timegm()} \hyperlink{posix_8h_a1c3d85ae80df5590fa314acffd8bf840}{P\+O\+S\+IX} function. 

\hyperlink{time_8c_a3b1394c042dadbb7086e4facb6c87186}{normalize()} and \hyperlink{time_8c_ab5470ed361255861f6db7f5154587ea0}{tm2epoch} non \hyperlink{posix_8h_a1c3d85ae80df5590fa314acffd8bf840}{P\+O\+S\+IX} functions 
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
Seconds since E\+P\+O\+C\+H\+\_\+\+Y\+E\+AR Jan 1st. 

-\/1 on error. 
\end{DoxyReturn}


Definition at line 347 of file time.\+c.



Referenced by display\+\_\+clock(), fat\+\_\+time\+\_\+to\+\_\+unix(), find\+\_\+dst(), initialize\+\_\+clock(), and setdate\+\_\+r().

\index{time.\+h@{time.\+h}!tm\+\_\+mon\+\_\+to\+\_\+ascii@{tm\+\_\+mon\+\_\+to\+\_\+ascii}}
\index{tm\+\_\+mon\+\_\+to\+\_\+ascii@{tm\+\_\+mon\+\_\+to\+\_\+ascii}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{tm\+\_\+mon\+\_\+to\+\_\+ascii(int i)}{tm_mon_to_ascii(int i)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ tm\+\_\+mon\+\_\+to\+\_\+ascii (
\begin{DoxyParamCaption}
\item[{int}]{i}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_a0dd83b6492eb8473cb55bb45d8fc6c0c}{}\label{time_8h_a0dd83b6492eb8473cb55bb45d8fc6c0c}


Get string Short name of Month from month number. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em i} & Month 0 .. 11 to string.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
string pointer to month. 

\char`\"{}\+B\+A\+D\char`\"{} on error. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{time_8c_a7ffc52def0c7fbf70c50248e3f7d6a8a}{asctime\+\_\+r()} 
\end{DoxySeeAlso}


Definition at line 114 of file time.\+c.

\index{time.\+h@{time.\+h}!tm\+\_\+wday\+\_\+to\+\_\+ascii@{tm\+\_\+wday\+\_\+to\+\_\+ascii}}
\index{tm\+\_\+wday\+\_\+to\+\_\+ascii@{tm\+\_\+wday\+\_\+to\+\_\+ascii}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{tm\+\_\+wday\+\_\+to\+\_\+ascii(int i)}{tm_wday_to_ascii(int i)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} char$\ast$ tm\+\_\+wday\+\_\+to\+\_\+ascii (
\begin{DoxyParamCaption}
\item[{int}]{i}
\end{DoxyParamCaption}
)}\hypertarget{time_8h_ac7a571349cf5217b6261a01bf85a79ab}{}\label{time_8h_ac7a571349cf5217b6261a01bf85a79ab}


Get string Short name of day from day number. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em i} & Day 0 .. 6.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
string pointer to day. 

\char`\"{}\+B\+A\+D\char`\"{} on error. 
\end{DoxyReturn}


Definition at line 87 of file time.\+c.



\subsection{Variable Documentation}
\index{time.\+h@{time.\+h}!\+\_\+\+\_\+clock@{\+\_\+\+\_\+clock}}
\index{\+\_\+\+\_\+clock@{\+\_\+\+\_\+clock}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{\+\_\+\+\_\+clock}{__clock}}]{\setlength{\rightskip}{0pt plus 5cm}volatile {\bf ts\+\_\+t} \+\_\+\+\_\+clock}\hypertarget{time_8h_a335451dd774ecb4b696d501b4c1b6f30}{}\label{time_8h_a335451dd774ecb4b696d501b4c1b6f30}


System Clock Time. 



Definition at line 38 of file timer.\+c.

\index{time.\+h@{time.\+h}!\+\_\+\+\_\+tzone@{\+\_\+\+\_\+tzone}}
\index{\+\_\+\+\_\+tzone@{\+\_\+\+\_\+tzone}!time.\+h@{time.\+h}}
\subsubsection[{\texorpdfstring{\+\_\+\+\_\+tzone}{__tzone}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf tz\+\_\+t} \+\_\+\+\_\+tzone}\hypertarget{time_8h_a9ac29ed71adf6807175d24ab1fa622a7}{}\label{time_8h_a9ac29ed71adf6807175d24ab1fa622a7}


System Time Zone. 



Definition at line 49 of file time.\+c.

